package com.block.datapush.service.apipush.utils;

import cn.hutool.core.util.StrUtil;
import com.block.common.enums.BaseTypeInfoEnum;
import lombok.Data;

/**
 * e时代双授权
 */
@Data
public class YiShiDaiSsqUtil {

    private String phoneMd5;
    private String city;
    private String overdue;
    private String carInfo;
    private String loanAmount;
    private String bizLicenseYear;
    private String hbLimit;
    private String sesameCredit;
    private String career;
    private String socialSecurity;
    private String btLimit;
    private String realEstateInfo;
    private String age;
    private String providentFund;
    private String creditLimit;
    private String insurancePolicy;

    private String phone;
    private String userName;
    private String ip;

    public static String getyuqi(String yuqi) {
        if (BaseTypeInfoEnum.Yuqi.yq001.getValue().equals(yuqi)) {
            return "1";
        }else if (BaseTypeInfoEnum.Yuqi.yq002.getValue().equals(yuqi) || BaseTypeInfoEnum.Yuqi.yq003.getValue().equals(yuqi) || BaseTypeInfoEnum.Yuqi.yq004.getValue().equals(yuqi)) {
            return "2";
        }
        return "3";
    }

    public static String getCar(String car) {
        if (StrUtil.equals(BaseTypeInfoEnum.Car.car001.getValue(), car)) {
            return "1";
        }else if (StrUtil.equals(BaseTypeInfoEnum.Car.car003.getValue(), car)) {
            return "2";
        }else if (StrUtil.equals(BaseTypeInfoEnum.Car.car002.getValue(), car)) {
            return "3";
        }
        return "4";
    }

    public static String getloan(String loan) {
        if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la001.getValue(), loan)) {
            return "1";
        } else if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la003.getValue(), loan)) {
            return "2";
        }else if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la004.getValue(), loan)) {
            return "3";
        }else if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la005.getValue(), loan)) {
            return "4";
        }
        return "2";

    }

    public static String getHuabei(String huabei) {
        if (StrUtil.equals(BaseTypeInfoEnum.Huabei.hb001.getValue(), huabei)) {
            return "1";
        }
        return "5";
    }

    public static String getZhimaScore(String zhima) {
        if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm001.getValue(), zhima) || StrUtil.equals(BaseTypeInfoEnum.Zhima.zm002.getValue(), zhima)) {
            return "1";
        } else if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm003.getValue(), zhima)) {
            return "2";
        } else if (StrUtil.equals(BaseTypeInfoEnum.Zhima.zm004.getValue(), zhima)) {
            return "3";
        }
        return "4";
    }

    public static String getjob(String job) {
        if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz001.getValue(), job)) {
            return "1";
        } else if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz003.getValue(), job)) {
            return "2";
        } else if (StrUtil.equals(BaseTypeInfoEnum.Gongzuo.gz004.getValue(), job)) {
            return "4";
        }
        return "5";
    }

    public static String getSocialInsurance(String shebao) {
        if (StrUtil.equals(BaseTypeInfoEnum.Shebao.sb001.getValue(), shebao)) {
            return "1";
        }else if (StrUtil.equals(BaseTypeInfoEnum.Shebao.sb002.getValue(), shebao)) {
            return "2";
        }else if (StrUtil.equals(BaseTypeInfoEnum.Shebao.sb003.getValue(), shebao)) {
            return "3";
        }
        return "4";
    }

    public static String getBaitiao(String baitiao) {
        if (StrUtil.equals(BaseTypeInfoEnum.Baitiao.bt001.getValue(), baitiao)) {
            return "1";
        }
        return "5";
    }

    public static String getHouse(String house) {
        if (StrUtil.equals(BaseTypeInfoEnum.House.hu001.getValue(), house)) {
            return "1";
        }else if (StrUtil.equals(BaseTypeInfoEnum.House.hu004.getValue(), house)) {
            return "2";
        }else if (StrUtil.equals(BaseTypeInfoEnum.House.hu003.getValue(), house)) {
            return "3";
        }
        return "6";
    }

//    public static String getAge(Integer age) {
//        if (age >= 14 && age <= 21) {
//            return "1";
//        }else if (age >= 22 && age <= 55) {
//            return "2";
//        }else if (age >= 56 && age <= 70) {
//            return "3";
//        }
//        return "1";
//    }

    public static String getSex(Integer sex){
        if (sex == 1){
            return "0";
        }
        return "1";
    }

    public static String getGjj(String gongjijin) {
        if (StrUtil.equals(BaseTypeInfoEnum.Gjj.gjj001.getValue(), gongjijin)) {
            return "1";
        } else if (StrUtil.equals(BaseTypeInfoEnum.Gjj.gjj002.getValue(), gongjijin)) {
            return "2";
        }if (StrUtil.equals(BaseTypeInfoEnum.Gjj.gjj003.getValue(), gongjijin)) {
            return "3";
        }
        return "4";
    }

    public static String getXinyongka(String xinyongka) {
        if (StrUtil.equals(BaseTypeInfoEnum.XinYongKa.xyk001.getValue(), xinyongka)) {
            return "1";
        }
        return "6";
    }

    public static String getbaodan(String baodan) {
        if (StrUtil.equals(BaseTypeInfoEnum.Baoxian.bx001.getValue(), baodan)) {
            return "1";
        }
        return "4";
    }



















    public static Integer getxueli(String xueli) {
        if (StrUtil.equals(BaseTypeInfoEnum.XueLi.xl001.getValue(), xueli)) {
            return 0;
        } else if (StrUtil.equals(BaseTypeInfoEnum.XueLi.xl002.getValue(), xueli)) {
            return 0;
        } else if (StrUtil.equals(BaseTypeInfoEnum.XueLi.xl003.getValue(), xueli)) {
            return 1;
        }
        return 2;
    }











    public static Integer getloantime(String loantime) {
        if (StrUtil.equals(BaseTypeInfoEnum.LoanTime.lt001.getValue(), loantime)) {
            return 0;
        } else if (StrUtil.equals(BaseTypeInfoEnum.LoanTime.lt002.getValue(), loantime)) {
            return 1;
        } else if (StrUtil.equals(BaseTypeInfoEnum.LoanTime.lt003.getValue(), loantime)) {
            return 2;
        }
        return 5;

    }

    public static Integer getYongtu(String yongtu) {
        if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt001.getValue(), yongtu)) {
            return 6;
        } else if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt004.getValue(), yongtu)) {
            return 0;
        } else if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt005.getValue(), yongtu)) {
            return 1;
        }else if (StrUtil.equals(BaseTypeInfoEnum.Yongtu.yt003.getValue(), yongtu)) {
            return 4;
        }
        return 6;

    }



}
